# check root
if [ "$EUID" -ne 0 ]; then
	echo "错误：此脚本必须以 root 用户身份运行" >&2
	exit 1
fi

# network
bash -c "$(curl -fsSL https://gitee.com/hevey88/install_script/raw/main/rocky_dns_single_request.sh)"

# source
bash -c "$(curl -fsSL https://gitee.com/hevey88/install_script/raw/main/rocky_mirrors.sh)"

# package
sudo dnf install epel-release sudo curl git strace wget -y
# usermod -aG wheel jacky

# eple
sudo bash -c "$(curl -fsSL https://gitee.com/hevey88/install_script/raw/main/epel_install.sh)"

# sudo nopasswd
sudo echo "$(id -nu 1000) ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/user_nopasswd >/dev/null

# timezone and hostname
sudo timedatectl set-timezone Asia/Shanghai
sudo hostnamectl set-hostname rocky10

# grub
sudo bash -c "$(curl -fsSL https://gitee.com/hevey88/install_script/raw/main/grub2_time.sh)"

# neovim as default_editor
sudo bash -c "$(curl -fsSL https://gitee.com/hevey88/install_script/raw/main/neovim_default_editor.sh)"

# sudo bash -c "$(curl -fsSL https://gitee.com/hevey88/install_script/raw/main/rocky_init_pd.sh)"
